<style>
.msg 		{display:inline-block; background-color:#FFE; border:1px solid #EEC; padding:5px 10px; text-align:center;}
.msg_yes 	{display:inline-block; background-color:#DFE; border:1px solid #CED; padding:5px 10px; text-align:center;}
.msg_no 	{display:inline-block; background-color:#FEE; border:1px solid #ECC; padding:5px 10px; text-align:center; color:#900;}
</style>
<div class="popup" style="width:450px;">
	<div class="header">
		<i class="icon_w icon_friend"></i>
		个人设置
		<i class="icon_w icon_close" style="float:right; cursor:pointer;" onclick="UM_LAYER.close();"></i>
	</div>
	<div class="content left">
		<div class="sub_title">
			修改个人昵称：
		</div>
		<div style="padding:10px 10px 10px 30px;">
			<input class="input" type="text" name="new_nickname" id="new_nickname" value="<{$nickname}>" style="width:120px;" onkeyup="check_nick();">
			<input type="hidden" name="old_nickname" id="old_nickname" value="<{$nickname}>">

			<span id="btn_nickname" style="padding:0 0 0 20px;"><button class="submit" onclick="edit_nickname();">修改昵称</button></span>
		</div>
		<{if $account_info.isbind}>
			<div class="sub_title">
				已经绑定的账号
			</div>
			<{section loop=$account_info.isbind name=i}>
				<div style="padding:5px 30px;">
					<{$account_info.isbind[i].img}>
					<{$account_info.isbind[i].name}>
				</div>
			<{/section}>
		<{/if}>
		<{if $account_info.nobind}>
			<div class="sub_title">
				未绑定的账号
			</div>
			<{section loop=$account_info.nobind name=i}>
				<div style="padding:5px 30px;">
					<a href="<{$account_info.nobind[i].link}>">
						<{$account_info.nobind[i].img}>
						点击进入授权页面
					</a>
				</div>
			<{/section}>
		<{/if}>

		<script type="text/javascript">
			function edit_nickname () {
				var nickname 	= $('#new_nickname').val();
				var old		= $('#old_nickname').val();
				var btn		= $('#btn_nickname');
				
				if (nickname == old) {
					UM_LAYER.close();
				} else {
					btn.html('操作中...');
					nickname = encodeURIComponent(nickname);
					loadMod('index/action_edit_nickname', {'nickname':nickname}, '', function (msg) {
						if (msg == 'true') {
							btn.html('修改完成');
						} else {
							btn.html('<span style="color:red;">修改失败！</span>');
						}
					} );
				}
			}
		</script>
	</div>
</div>